﻿using BW.MesProject.Production.Domain.Dto.Input.ProcessManagement;
using BW.MesProject.Production.Domain.Dto.Output.ProcessManagement;
using BW.MesProject.Production.Infrastructure;
using BW.MesProject.Public.ErrorCode;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BW.MesProject.Production.Host.Controllers
{
    /// <summary>
    /// 工序管理
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProcessManageController : ControllerBase
    {
        private readonly IProcessManagementServices _processManagementServices;
        public ProcessManageController(IProcessManagementServices processManagementServices)
        {
            _processManagementServices = processManagementServices;
        }
        [HttpPost]
        public ApiResult<int> CreateProcessManagement(CreateProcessManagementInput input)
        {
            return _processManagementServices.CreateProcessManagement(input);
        }
        [HttpDelete]
        public ApiResult<int> DeleteProcessManagement(long Id)
        {
           return _processManagementServices.DeleteProcessManagement(Id);
        }
        [HttpGet]
        public ApiResult<List<ProcessManagementListOutput>> GetProcessManagementList()
        {
            return _processManagementServices.GetProcessManagementList();
        }
        [HttpPut]
        public ApiResult<int> UpdateProcessManagement(UpdateProcessManagementInput input)
        {
            return _processManagementServices.UpdateProcessManagement(input);
        }
    }
}
